<?php

namespace App\Listeners;

use App\Events\PayEvent;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use App\Models\Pay;

class PayListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  PayEvent  $event
     * @return void
     */
    public function handle(PayEvent $event)
    {
        $pay = new Pay();
        $pay->manager_id = $event->manager_id;
        $pay->server_id = $event->server_id;
        $pay->player_id = $event->player_id;
        $pay->order_num = $event->order_num;
        $pay->type = $event->type;
        $pay->money = $event->money;
        $pay->payway = $event->payway;
        $pay->state = $event->state;
        $pay->info = $event->info;
        $pay->pay_purpose = $event->pay_purpose;
        $pay->save();
    }
}
